package com.jdz.service;

import com.github.pagehelper.PageInfo;
import com.jdz.common.ServerResponse;
import com.jdz.pojo.User;
import com.jdz.vo.ExportExcelVo;
import com.jdz.vo.ListUserVo;
import com.jdz.vo.UserVo;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * Created by sun
 **/

//用I开头很容易看出这是个接口
public interface IUserService {

    //接口中所有方法默认都是public
    //实现类中，实现的类相当于子类，子类的访问权限是不能比父类小的，
    // 而在java中一个类如果没有权限的修饰符，默认是friendly
    // (同一个包内的其它类才可访问)，所以在实现类中一定要写public


    ServerResponse<UserVo> login(String stuid, String stuPassword);

    ServerResponse<String> register(User user);

    ServerResponse<String> checkValid(String str, String type);

//    ServerResponse selectQuestion(String username);
//
//    ServerResponse<String> checkAnswer(String username, String question, String answer);
//
//    ServerResponse<String> forgetResetPassword(String username, String passwordNew, String forgetToken);

    ServerResponse<String> resetPassword(String passwordOld, String passwordNew1, String passwordNew2, UserVo userVo);

    ServerResponse<UserVo> updateInformation(User user);

    ServerResponse<UserVo> getInformation(Integer stuId);

    ServerResponse<Integer> checkAdminRole(UserVo userVo);

    ServerResponse checkSAdminRole(UserVo userVo);

    ServerResponse checkPrivilege(UserVo userVo, String url);

    ServerResponse resetAdminPassword(List<Integer> stunoList, String password);

    ServerResponse adminLockUser(List<Integer> stunoList);

    ServerResponse adminDeblockUser(List<Integer> stunoList);

    ServerResponse deleteUser(List<Integer> stunoList);

    ServerResponse<List<ListUserVo>> listUser();

    //ServerResponse<PageInfo> listUserPage(int pageNum, int pageSize);

    ServerResponse<PageInfo> searchUser(String name, Integer groupno,int pageNum, int pageSize, int time_sort);

    ExportExcelVo<byte[]> exportBusInfo(List<Integer> stunoList, HttpServletRequest request, HttpServletResponse response) throws Exception;

    ServerResponse getPassword(HttpServletRequest request,String stuid);

    ServerResponse AddAdmin(User user);
}
